package timbap.visualizer.api.context.recorditems;

import timbap.visualizer.api.context.playlist.PlaylistManager;
import timbap.visualizer.api.model.PlaylistEntry;
import timbap.visualizer.api.model.RecordItem;

import java.util.List;

/**
 * The <code>RecordItemManager</code> is responsible for
 * managing the record items that are being displayed
 * by the visualizer.
 *
 * @author  Andreas Pabst
 * @see     timbap.visualizer.api.model.RecordItem
 */
public interface RecordItemManager {
	
	/**
	 * initializes the record items from the given
	 * playlist manager.
	 * 
	 * @param pPlaylistManager	the playlist manager
	 */
	public void initializeRecordItems(PlaylistManager pPlaylistManager);
	
	/**
	 * gets the record items
	 * 
	 * @return	the record items
	 */
	public List<RecordItem> getRecordItems();
	
	/**
	 * gets the number of record items
	 * 
	 * @return	the number of record items
	 */
	public int getRecordItemCount();
	
	/**
	 * gets the record item at the specified position
	 * 
	 * @param i	the position index
	 * @return	the record item at the specified position
	 */
	public RecordItem getRecordItemAt(int i);
	
	/**
	 * sets the record item at the specified position
	 * 
	 * @param i	the position index
	 * @param pRecordItem	the record item to set
	 */
	public void setRecordItemAt(int i, RecordItem pRecordItem);
	
	/**
	 * gets the currently selected record item
	 * 
	 * @return	the currently selected record item
	 */
	public RecordItem getSelectedRecordItem();
	
	/**
	 * sets the selected record item to the one at
	 * the specified position index
	 * 
	 * @param pSelectedItemIndex	the index of the item to be selected
	 */
	public void setSelectedRecordItemIndex(int pSelectedItemIndex);
	
	/**
	 * gets the position index of the currently 
	 * selected record item
	 * 
	 * @return	the index of the selected record item
	 */
	public int getSelectedRecordItemIndex();

	/**
	 * assigns a playlist entry to a record item 
	 * 
	 * @param pRecordItem	the record item to assign the playlist entry to
	 * @param pPlaylistEntry	the playlist entry to assign
	 */
	public void setPlaylistEntry(RecordItem pRecordItem, PlaylistEntry pPlaylistEntry);

	/**
	 * assigns every playlist entry in the provided list
	 * to the respective record item at the same index.
	 * 
	 * @param pPlaylistEntries	the new playlist entries to set
	 */
	public void setPlaylistEntries(List<PlaylistEntry> pPlaylistEntries);
	
}
